
export const saveUserStoreLimits = (state, userStoreLimits) => {
    state.userStoreLimits = userStoreLimits;
    state.userInfoStore['optPermission'] = []
    console.log('userStoreLimits', userStoreLimits)
    console.log('用户角色', state.userInfoStore.userType)
    for (let index = 0; index < userStoreLimits.length; index++) {
        const element = userStoreLimits[index];

        if(element.type==state.userInfoStore.userType){
            //一层
            // state.userInfoStore['optPermission'].push(element.value)
            //二层
            var array = element['data']
            console.log('data-array', array,'element',  element)
            for (let index1 = 0; index1 < array.length; index1++) {
                const element1 = array[index1];
                if(element1.value!=null&& element1.value!=undefined)
                {state.userInfoStore['optPermission'].push(element1.value)}
                //三层
                var array2 = element1['children']
                for (let index2 = 0; index2 < array2.length; index2++) {
                    const element2 = array2[index2];
                    if(element2.value!=null&& element2.value!=undefined)
                        {state.userInfoStore['optPermission'].push(element2.value)}
                }
            }
        }
    }
}  
export const saveUserInfoStore = (state, userInfoStore) => {
    state.userInfoStore = userInfoStore;
}  